import Vue from 'vue'
import VueRouter from 'vue-router'

import layout from '@/views/layout'
import home from '@/views/home'
import play from '@/views/play'
import search from '@/views/search'

Vue.use(VueRouter)

const routes = [
   { path: '/', redirect: '/layout/home' },
   {
      name: 'layout', path: '/layout', component: layout, children: [
         {
            name: 'home', path: 'home', component: home, meta: {
               title: '首页'
            }
         },
         {
            name: 'search', path: 'search', component: search, meta: {
               title: '搜素'
            }
         }
      ]
   },
   { name: 'play', path: '/play', component: play }
]

const router = new VueRouter({
   routes
})

export default router